<template>
    <view class="flex inner fit-width pb20">
        <image :src="item.image" class="li-img" />
        <view class="flex-1 ml20 fit-width">
            <view class="f32">
                <text class="li-txt">{{ item.goods_sku.goods_attr || item.goods_name}}</text>
            </view>
            <view class="gray f26">月销：{{ item.goods_sales }}</view>
            <!-- <view class="gray f26">库存：200 件</view> -->
            <view class="gray f26">价格：{{ item.goods_price }} 元</view>
        </view>
        <view class="align-self-end">
            <product-change1 :selected.sync="item.total_num" @onChange1="onChange1"/> 
        </view>
    </view>
</template>

<script>
    import productChange1 from './product-change1.vue'
	export default {
        name:'goodsCart',
        components: {
            productChange1
        },
        props:{
            item:{
                type: Object,
                default: ()=>{}
            },
            categoryItem:{
                type: Object,
                default: ()=>{}
            },
        },
		methods: {
            onChange1({type}){
                console.log({id:this.categoryItem.id,item:this.item});
                this.$emit('onChange1',{id:this.categoryItem.id,item:this.item,type})
            }
		}
	}
</script>

<style lang="scss" scoped>
    @import '../base.scss';
    .align-self-end{
        align-self: flex-end
    }
	.li-img{
		width: 120rpx;
		height: 120rpx;
		border-radius: 10rpx;
	}
	.li-txt{
	}
</style>
